<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<#include "lib/lib.html" />
<title>修改支付方式</title>
<style>
	.adddl #spic{
		height:40px;
	}
</style>
</head>
<body>
	<form action="${basePath}/payType/updatePaytype.do" method="post" class="form form-horizontal" id="form-payway-edit">
		<div class="pop_main">
		<dl  class="adddl">
			<dt></span>支付平台：</label>
			</dt>
			<dd>
				<select class="select" id="payWayId" name="payWayId" size="1">
					<#if payWayList?? && payWayList?size gt 0>
					<#list payWayList as dl>
						<option value="${dl.id}"<#if dl.id == payType.payWayId>selected="selected"</#if>>${dl.wayName}</option>
					</#list>
					</#if>
				</select>
			</dd>
		</dl>

		<dl  class="adddl">
			<dt></span>支付方式名称：</label>
			</dt>
			<dd>
				<input type="text" class="dd_input" value="${payType.payTypeName}" placeholder="支付方式名称" id="payTypeName" name="payTypeName" datatype="*"  nullmsg="请输入支付方式名称" >
			</dd>
		</dl>
		
		<dl  class="adddl">
			<dt></span>字典匹配值：</label>
			</dt>
			<dd>
				<input type="text" class="dd_input" value="${payType.dictName}" placeholder="字典匹配值" id="dictName" name="dictName" datatype="*"  nullmsg="请输入字典匹配值" >
				<input type="text" class="dd_input hide" value="${payType.id}" placeholder="当前对象主键" id="id" name="id" datatype="*">
			</dd>
		</dl>
		<div class="submit_btn">
			<input type="button" value="确定" onclick="submitButt()">
		</div>
		</div>
	</form>
<script type="text/javascript">
		$(function(){
			$("#form-payway-edit").Validform({
				tiptype:3,
				showAllError:true,   //表单提交时显示所有提示信息
				ignoreHidden: true,  //隐藏的表单元素不校验
				ajaxPost:true,
				callback:function(data){
					if(!!data&&data.resultCode==200){
						layer.msg('保存成功!', {
							icon : 1,
							time : 1000
						});
						parent.location.replace("${basePath}/payType/alldata.do");
						layer_close();
					}else if(data.resultCode==201){
						layer.alert("你已经添加过改字典匹配值！请查看支付方式",{yes:function(){
					        parent.location.replace("${basePath}/payType/alldata.do");
							layer_close();
					    }});
					}else if(data.resultCode==202){
						layer.alert("当前支付平台下已经存在该支付方式名称！请查看支付方式",{yes:function(){
					        parent.location.replace("${basePath}/payType/alldata.do");
							layer_close();
					    }});
					}else{
						$("#form-app-edit").resetForm();
						layer.msg('保存失败，请你检查数据!', {
							icon : 1,
							time : 1000
						});
					}
				}
			});
		});
		function submitButt(){
			$("#form-payway-edit").attr(
					"action",
					"${basePath}/payType/updatePaytype.do").submit();
		}
</script>
</body>
</html>